package com.yc.service;

import com.yc.feign.GenerateIdFeignClient;
import com.yc.feign.HelloFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class GetInfoService {
    @Autowired
    HelloFeignClient helloFeignClient;
    @Autowired
    GenerateIdFeignClient generateIdFeignClient;

    public String getInfoFromService(){
        log.info("开始调用远程服务获取信息...");
        String helloInfo = String.valueOf(  helloFeignClient.sayHello() );
        log.info("调用service-hello服务，获取到问候结果{}",helloInfo);

        String IdInfo = String.valueOf(generateIdFeignClient.generateId());
        log.info("调用service-generateId服务，获取到雪花Id结果{}",IdInfo);
        return helloInfo+IdInfo;

    }
}
